package com.wom.blockfeatures;

import com.wom.blocks.AbstractBlock;
import com.wom.blocks.AirBlock;
import com.wom.blocks.VoidRock;
import com.wom.blocks.WaterBlock;
import com.wom.worldmaker.GameWorld;


public class FallingBlock {

	public FallingBlock(){
		super();
	}


	public void fall(AbstractBlock thisBlock){
		AbstractBlock belowBlock=BlockUtils.getBlockBelow(thisBlock);

		if(belowBlock!=null){

			if(belowBlock instanceof AirBlock || belowBlock instanceof WaterBlock){


				
				int tempY=belowBlock.getyPos();
				belowBlock.setyPos(thisBlock.getyPos());
				GameWorld.gameBlocks[thisBlock.getxPos()][thisBlock.getyPos()]=belowBlock;

				thisBlock.setyPos(tempY);
				GameWorld.gameBlocks[thisBlock.getxPos()][thisBlock.getyPos()]=thisBlock;



			}
			else if(belowBlock instanceof VoidRock){
				
			}



		}

	}

}




